package com.ts.api.http.platform.biz;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gitee.apanlh.util.algorithm.encrypt.symmetric.AES;
import com.gitee.apanlh.util.base.*;
import com.gitee.apanlh.util.dataformat.JsonUtils;
import com.gitee.apanlh.util.valid.ValidParam;
import com.gitee.apanlh.web.model.vo.RequestVO;
import com.ts.api.common.util.H5DomainUrlUtils;
import com.ts.api.http.platform.entity.apply.ApiPlatApplyWeiKeJinRong;
import com.ts.api.http.platform.entity.dataexchange.ApiPlatDataExchangeWeiKeJinRong;
import com.ts.api.module.api.convert.core.annotation.ApiPlan;
import com.ts.api.module.api.convert.core.annotation.ApiPlanConvertType;
import com.ts.api.module.api.convert.core.entity.ApiApplyParameter;
import com.ts.api.module.api.convert.core.entity.ApiBizStatus;
import com.ts.api.module.api.convert.core.entity.ApiDataExchangeParameter;
import com.ts.api.module.api.convert.core.utils.ApiFieldConverter;
import com.ts.api.module.api.convert.platform.entity.*;
import com.ts.api.module.api.convert.platform.handler.ApiPlatformPhoneMd5ConvertHandler;
import com.ts.api.module.api.entity.ApiProtocol;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 安心分期（出）&微客金融 全28
 *
 * @author gwc
 * @create 2025-08-15 上午11:39
 */
@ApiPlan(productId = "229", type = ApiPlanConvertType.PLAT_PHONE_MD5)
public class ApiPlatWeiKeJinRongMd5Convert implements ApiPlatformPhoneMd5ConvertHandler {

    private static final String KEY = "W9BCRjFXIXZbfRVy9w10sg==";
    private static final String IV = "f0mftxnsf43ffdsb";
    private static final String ORGAN_CODE = "QDAnXinFQWholeCredit";

    @Override
    public Object dataExchange(ApiDataExchangeParameter apiDataExchangeParameter) throws Exception {
        // 创建对应的撞库实体类
        ApiPlatDataExchangeWeiKeJinRong weiKeJinRongData = new ApiPlatDataExchangeWeiKeJinRong();
        // 拓展
        ApiFieldConverter apiFieldConverter = ApiFieldConverter.create(apiDataExchangeParameter);
        // 手机号MD5（32位小写）
        weiKeJinRongData.setPhoneMd5(apiDataExchangeParameter.getPhoneMd5());
        // 城市名称
        weiKeJinRongData.setCityName(apiDataExchangeParameter.getCity());
        // 性别 0：女 1：男
        Integer sex = ChooseEq.create()
                .when(apiDataExchangeParameter.getSex(), "1", 0)
                .when(apiDataExchangeParameter.getSex(), "0", 1)
                .end(1);
        weiKeJinRongData.setSex(sex);
        // 年龄
        weiKeJinRongData.setAge(apiFieldConverter.getAgeInt());
        // 申请金额（元）
        Integer money = ChooseEq.create()
                .when(apiDataExchangeParameter.getLoanAmount(), "1", 30000)
                .when(apiDataExchangeParameter.getLoanAmount(), "2", 50000)
                .when(apiDataExchangeParameter.getLoanAmount(), "3", 100000)
                .when(apiDataExchangeParameter.getLoanAmount(), "4", 200000)
                .end(30000);
        weiKeJinRongData.setAmount(money);
        // 借款期限（月） 默认值24
        Integer loanTerm= ChooseEq.create()
                .when(apiDataExchangeParameter.getLoanTerm(), "1", 3)
                .when(apiDataExchangeParameter.getLoanTerm(), "2", 6)
                .when(apiDataExchangeParameter.getLoanTerm(), "3", 12)
                .when(apiDataExchangeParameter.getLoanTerm(), "4", 24)
                .when(apiDataExchangeParameter.getLoanTerm(), "5", 36)
                .when(apiDataExchangeParameter.getLoanTerm(), "6", 60)
                .end(24);
        weiKeJinRongData.setTerm(loanTerm);
        // 用户IP
        if (ValidParam.isEmpty(apiDataExchangeParameter.getIp())){
            weiKeJinRongData.setClientIp("127.0.0.1");
        }else {
            weiKeJinRongData.setClientIp(apiDataExchangeParameter.getIp());
        }
        // 芝麻分 1：600分以下 2：600-650分 3：650-700分 4：700分以上
        Integer zhima = ChooseEq.create()
                .when(apiDataExchangeParameter.getSesameCredit(), "1", 1)
                .when(apiDataExchangeParameter.getSesameCredit(), "2", 2)
                .when(apiDataExchangeParameter.getSesameCredit(), "3", 3)
                .when(apiDataExchangeParameter.getSesameCredit(), "4", 4)
                .end(1);
        weiKeJinRongData.setSesameCredit(zhima);
        // 公积金 1：无公积金 2：缴纳未满6个月 3：缴纳6个月以上
        Integer gongjijin = ChooseEq.create()
                .when(apiDataExchangeParameter.getProvidentFund(), "1", 1)
                .when(apiDataExchangeParameter.getProvidentFund(), "2", 2)
                .when(apiDataExchangeParameter.getProvidentFund(), "3", 3)
                .when(apiDataExchangeParameter.getProvidentFund(), "4", 2)
                .end(1);
        weiKeJinRongData.setAccumulationFund(gongjijin);
        // 社保 1：无社保 2：缴纳未满6个月 3：缴纳6个月以上
        Integer shebao = ChooseEq.create()
                .when(apiDataExchangeParameter.getSocialSecurity(), "1", 1)
                .when(apiDataExchangeParameter.getSocialSecurity(), "2", 2)
                .when(apiDataExchangeParameter.getSocialSecurity(), "3", 3)
                .when(apiDataExchangeParameter.getSocialSecurity(), "4", 2)
                .end(1);
        weiKeJinRongData.setSocialSecurity(shebao);
        // 商业保险 1：无保险 2：缴纳不足1年 3：缴纳1年以上 4：缴纳2年以上
        Integer baodanIs = ChooseEq.create()
                .when(apiDataExchangeParameter.getInsurancePolicy(), "1", 1)
                .when(apiDataExchangeParameter.getInsurancePolicy(), "2", 2)
                .when(apiDataExchangeParameter.getInsurancePolicy(), "3", 3)
                .when(apiDataExchangeParameter.getInsurancePolicy(), "4", 2)
                .end(1);
        weiKeJinRongData.setInsurance(baodanIs);
        // 房产 0：无房产 1：有房产
        Integer house = ChooseEq.create()
                .when(apiDataExchangeParameter.getRealEstateInfo(), "1", 0)
                .when(apiDataExchangeParameter.getRealEstateInfo(), "2", 1)
                .when(apiDataExchangeParameter.getRealEstateInfo(), "3", 1)
                .when(apiDataExchangeParameter.getRealEstateInfo(), "4", 1)
                .when(apiDataExchangeParameter.getRealEstateInfo(), "5", 1)
                .when(apiDataExchangeParameter.getRealEstateInfo(), "6", 1)
                .end(0);
        weiKeJinRongData.setHouseProperty(house);
        // 车产 0：无车产 1：有车产
        Integer car = ChooseEq.create()
                .when(apiDataExchangeParameter.getCarInfo(), "1", 0)
                .when(apiDataExchangeParameter.getCarInfo(), "2", 1)
                .when(apiDataExchangeParameter.getCarInfo(), "3", 1)
                .when(apiDataExchangeParameter.getCarInfo(), "4", 1)
                .end(0);
        weiKeJinRongData.setCarProperty(car);
        // 信用卡逾期 1：有卡无逾期 2：6个月以上逾期 3：无卡
        Integer overdueChoose = ChooseEq.create()
                .when(apiDataExchangeParameter.getOverdue(), "1", 1)
                .when(apiDataExchangeParameter.getOverdue(), "2", 2)
                .when(apiDataExchangeParameter.getOverdue(), "3", 1)
                .end(3);
        weiKeJinRongData.setOverdue(overdueChoose);
        // 教育程度 1：初中及以下 2：高中/中专技校 3：大专 4：本科 5：研究生及以上
        Integer educationAttainment = ChooseEq.create()
                .when(apiDataExchangeParameter.getEducationAttainment(), "1", 1)
                .when(apiDataExchangeParameter.getEducationAttainment(), "2", 2)
                .when(apiDataExchangeParameter.getEducationAttainment(), "3", 2)
                .when(apiDataExchangeParameter.getEducationAttainment(), "4", 3)
                .when(apiDataExchangeParameter.getEducationAttainment(), "5", 4)
                .when(apiDataExchangeParameter.getEducationAttainment(), "6", 5)
                .end(1);
        weiKeJinRongData.setQualification(educationAttainment);
        // 职业类别 1：上班族 2：事业单位/公务员 3：私营企业 4：自由职业者 5：其他
        Integer job = ChooseEq.create()
                .when(apiDataExchangeParameter.getCareer(), "1", 1)
                .when(apiDataExchangeParameter.getCareer(), "2", 4)
                .when(apiDataExchangeParameter.getCareer(), "3", 3)
                .when(apiDataExchangeParameter.getCareer(), "4", 2)
                .when(apiDataExchangeParameter.getCareer(), "5", 5)
                .end(1);
        weiKeJinRongData.setOccupation(job);
        // 单位工龄 1：0~6个月 2：6~12个月 3：12个月以上
        Integer yearsService = ChooseEq.create()
                .when(apiDataExchangeParameter.getYearsService(), "1", 1)
                .when(apiDataExchangeParameter.getYearsService(), "2", 2)
                .when(apiDataExchangeParameter.getYearsService(), "3", 3)
                .end(1);
        weiKeJinRongData.setSeniority(yearsService);
        // 借款用途 1：日常消费 2：装修 3：医疗 4：教育 5：旅游 6：其他
        Integer loanUse = ChooseEq.create()
                .when(apiDataExchangeParameter.getLoanPurpose(), "1", 5)
                .when(apiDataExchangeParameter.getLoanPurpose(), "2", 4)
                .when(apiDataExchangeParameter.getLoanPurpose(), "3", 6)
                .when(apiDataExchangeParameter.getLoanPurpose(), "4", 2)
                .when(apiDataExchangeParameter.getLoanPurpose(), "5", 3)
                .when(apiDataExchangeParameter.getLoanPurpose(), "6", 1)
                .end(1);
        weiKeJinRongData.setPurpose(loanUse);
        // 月收入 1：2000以下 2：2000~5000 3：5000~8000 4：8000~10000 5：10000以上
        Integer incomeMonth = ChooseEq.create()
                .when(apiDataExchangeParameter.getMonthlySalary(), "1", 1)
                .when(apiDataExchangeParameter.getMonthlySalary(), "2", 2)
                .when(apiDataExchangeParameter.getMonthlySalary(), "3", 4)
                .when(apiDataExchangeParameter.getMonthlySalary(), "4", 5)
                .when(apiDataExchangeParameter.getMonthlySalary(), "5", 5)
                .end(1);
        weiKeJinRongData.setMonthIncome(incomeMonth);
        // 花呗额度 1：无额度 2：<5000 3：>5000
        Integer hbLimit = ChooseEq.create()
                .when(apiDataExchangeParameter.getHbLimit(), "1", 1)
                .when(apiDataExchangeParameter.getHbLimit(), "2", 2)
                .when(apiDataExchangeParameter.getHbLimit(), "3", 3)
                .when(apiDataExchangeParameter.getHbLimit(), "4", 3)
                .when(apiDataExchangeParameter.getHbLimit(), "5", 3)
                .end(1);
        weiKeJinRongData.setAntCredit(hbLimit);
        // 加密
        AES aes = AES.createCbc(KEY.getBytes(), IV.getBytes());
        String dataStr = aes.encryptToBase64Str(JsonUtils.toJson(weiKeJinRongData));
        return JsonUtils.toJson(MapUtils.newHashMap(newMap -> {
            newMap.put("organCode", ORGAN_CODE);
            newMap.put("data", dataStr);
        }));
    }

    @Override
    public RespPlatformPhoneMd5DataExchange respDataExchange(String respJson) throws Exception {
        JSONObject jsonObject = JsonUtils.get(respJson);
        if (jsonObject == null) {
            return RespPlatformPhoneMd5DataExchange.ofFail();
        }
        if (!Eq.object(jsonObject.getInteger("code"), 200)) {
            return RespPlatformPhoneMd5DataExchange.ofFail();
        }
        // 获取响应数据
        String resData = jsonObject.getString("data");
        if(!ValidParam.isNotEmpty(resData)){
            return RespPlatformPhoneMd5DataExchange.ofFail();
        }
        // 解密
        AES aes = AES.createCbc(KEY.getBytes(), IV.getBytes());
        String decData = aes.decryptFromBase64Str(resData);
        JSONObject data = JsonUtils.get(decData);
        if(!ValidParam.isNotEmpty(data)){
            return RespPlatformPhoneMd5DataExchange.ofFail();
        }
        if(!Eq.object(data.getInteger("result"), 1)){
            return RespPlatformPhoneMd5DataExchange.ofFail();
        }
        String priceStr = data.getString("price");
        BigDecimal price = new BigDecimal(priceStr).setScale(2, RoundingMode.HALF_UP);
        String companyName = data.getString("companyName");
        String productName = data.getString("productName");
        // 用户协议
        List<ApiProtocol> protocolList = new ArrayList<>();
        // 获取协议
        JSONArray listProtocolResult = data.getJSONArray("protocols");
        IteratorUtils.array(listProtocolResult, (item, index) -> {
            JSONObject protocolObject = listProtocolResult.getJSONObject(index);
            ApiProtocol protocol = new ApiProtocol();
            protocol.setProtocolName(protocolObject.getString("protocolName"));
            protocol.setProtocolUrl(protocolObject.getString("protocolUrl"));
            protocolList.add(protocol);
        });
        RespPlatformPhoneMd5DataExchange result = RespPlatformPhoneMd5DataExchange.ofSuc();

        result.setPrice(price);
        result.setDisplayName(companyName);
        result.setProductName(productName);
        result.setProtocolList(protocolList);
        return result;
    }

    @Override
    public Object apply(ApiApplyParameter apiApplyParameter) throws Exception {
        // 创建对应的进件实体类
        ApiPlatApplyWeiKeJinRong weiKeJinRongData = new ApiPlatApplyWeiKeJinRong();
        // 拓展
        ApiFieldConverter apiFieldConverter = ApiFieldConverter.create(apiApplyParameter);
        // 手机号
        weiKeJinRongData.setPhone(apiApplyParameter.getPhone());
        // 用户姓名
        weiKeJinRongData.setName(apiApplyParameter.getUserName());
        // 城市名称
        weiKeJinRongData.setCityName(apiApplyParameter.getCity());
        // 性别 0：女 1：男
        Integer sex = ChooseEq.create()
                .when(apiApplyParameter.getSex(), "1", 0)
                .when(apiApplyParameter.getSex(), "0", 1)
                .end(1);
        weiKeJinRongData.setSex(sex);
        // 年龄
        weiKeJinRongData.setAge(apiFieldConverter.getAgeInt());
        // 申请金额（元）
        Integer money = ChooseEq.create()
                .when(apiApplyParameter.getLoanAmount(), "1", 30000)
                .when(apiApplyParameter.getLoanAmount(), "2", 50000)
                .when(apiApplyParameter.getLoanAmount(), "3", 100000)
                .when(apiApplyParameter.getLoanAmount(), "4", 200000)
                .end(30000);
        weiKeJinRongData.setAmount(money);
        // 借款期限（月） 默认值24
        Integer loanTerm= ChooseEq.create()
                .when(apiApplyParameter.getLoanTerm(), "1", 3)
                .when(apiApplyParameter.getLoanTerm(), "2", 6)
                .when(apiApplyParameter.getLoanTerm(), "3", 12)
                .when(apiApplyParameter.getLoanTerm(), "4", 24)
                .when(apiApplyParameter.getLoanTerm(), "5", 36)
                .when(apiApplyParameter.getLoanTerm(), "6", 60)
                .end(24);
        weiKeJinRongData.setTerm(loanTerm);
        // 用户IP
        if (ValidParam.isEmpty(apiApplyParameter.getIp())){
            weiKeJinRongData.setClientIp("127.0.0.1");
        }else {
            weiKeJinRongData.setClientIp(apiApplyParameter.getIp());
        }
        // 芝麻分 1：600分以下 2：600-650分 3：650-700分 4：700分以上
        Integer zhima = ChooseEq.create()
                .when(apiApplyParameter.getSesameCredit(), "1", 1)
                .when(apiApplyParameter.getSesameCredit(), "2", 2)
                .when(apiApplyParameter.getSesameCredit(), "3", 3)
                .when(apiApplyParameter.getSesameCredit(), "4", 4)
                .end(1);
        weiKeJinRongData.setSesameCredit(zhima);
        // 公积金 1：无公积金 2：缴纳未满6个月 3：缴纳6个月以上
        Integer gongjijin = ChooseEq.create()
                .when(apiApplyParameter.getProvidentFund(), "1", 1)
                .when(apiApplyParameter.getProvidentFund(), "2", 2)
                .when(apiApplyParameter.getProvidentFund(), "3", 3)
                .when(apiApplyParameter.getProvidentFund(), "4", 2)
                .end(1);
        weiKeJinRongData.setAccumulationFund(gongjijin);
        // 社保 1：无社保 2：缴纳未满6个月 3：缴纳6个月以上
        Integer shebao = ChooseEq.create()
                .when(apiApplyParameter.getSocialSecurity(), "1", 1)
                .when(apiApplyParameter.getSocialSecurity(), "2", 2)
                .when(apiApplyParameter.getSocialSecurity(), "3", 3)
                .when(apiApplyParameter.getSocialSecurity(), "4", 2)
                .end(1);
        weiKeJinRongData.setSocialSecurity(shebao);
        // 商业保险 1：无保险 2：缴纳不足1年 3：缴纳1年以上 4：缴纳2年以上
        Integer baodanIs = ChooseEq.create()
                .when(apiApplyParameter.getInsurancePolicy(), "1", 1)
                .when(apiApplyParameter.getInsurancePolicy(), "2", 2)
                .when(apiApplyParameter.getInsurancePolicy(), "3", 3)
                .when(apiApplyParameter.getInsurancePolicy(), "4", 2)
                .end(1);
        weiKeJinRongData.setInsurance(baodanIs);
        // 房产 0：无房产 1：有房产
        Integer house = ChooseEq.create()
                .when(apiApplyParameter.getRealEstateInfo(), "1", 0)
                .when(apiApplyParameter.getRealEstateInfo(), "2", 1)
                .when(apiApplyParameter.getRealEstateInfo(), "3", 1)
                .when(apiApplyParameter.getRealEstateInfo(), "4", 1)
                .when(apiApplyParameter.getRealEstateInfo(), "5", 1)
                .when(apiApplyParameter.getRealEstateInfo(), "6", 1)
                .end(0);
        weiKeJinRongData.setHouseProperty(house);
        // 车产 0：无车产 1：有车产
        Integer car = ChooseEq.create()
                .when(apiApplyParameter.getCarInfo(), "1", 0)
                .when(apiApplyParameter.getCarInfo(), "2", 1)
                .when(apiApplyParameter.getCarInfo(), "3", 1)
                .when(apiApplyParameter.getCarInfo(), "4", 1)
                .end(0);
        weiKeJinRongData.setCarProperty(car);
        // 信用卡逾期 1：有卡无逾期 2：6个月以上逾期 3：无卡
        Integer overdueChoose = ChooseEq.create()
                .when(apiApplyParameter.getOverdue(), "1", 1)
                .when(apiApplyParameter.getOverdue(), "2", 2)
                .when(apiApplyParameter.getOverdue(), "3", 1)
                .end(3);
        weiKeJinRongData.setOverdue(overdueChoose);
        // 教育程度 1：初中及以下 2：高中/中专技校 3：大专 4：本科 5：研究生及以上
        Integer educationAttainment = ChooseEq.create()
                .when(apiApplyParameter.getEducationAttainment(), "1", 1)
                .when(apiApplyParameter.getEducationAttainment(), "2", 2)
                .when(apiApplyParameter.getEducationAttainment(), "3", 2)
                .when(apiApplyParameter.getEducationAttainment(), "4", 3)
                .when(apiApplyParameter.getEducationAttainment(), "5", 4)
                .when(apiApplyParameter.getEducationAttainment(), "6", 5)
                .end(1);
        weiKeJinRongData.setQualification(educationAttainment);
        // 职业类别 1：上班族 2：事业单位/公务员 3：私营企业 4：自由职业者 5：其他
        Integer job = ChooseEq.create()
                .when(apiApplyParameter.getCareer(), "1", 1)
                .when(apiApplyParameter.getCareer(), "2", 4)
                .when(apiApplyParameter.getCareer(), "3", 3)
                .when(apiApplyParameter.getCareer(), "4", 2)
                .when(apiApplyParameter.getCareer(), "5", 5)
                .end(1);
        weiKeJinRongData.setOccupation(job);
        // 单位工龄 1：0~6个月 2：6~12个月 3：12个月以上
        Integer yearsService = ChooseEq.create()
                .when(apiApplyParameter.getYearsService(), "1", 1)
                .when(apiApplyParameter.getYearsService(), "2", 2)
                .when(apiApplyParameter.getYearsService(), "3", 3)
                .end(1);
        weiKeJinRongData.setSeniority(yearsService);
        // 借款用途 1：日常消费 2：装修 3：医疗 4：教育 5：旅游 6：其他
        Integer loanUse = ChooseEq.create()
                .when(apiApplyParameter.getLoanPurpose(), "1", 5)
                .when(apiApplyParameter.getLoanPurpose(), "2", 4)
                .when(apiApplyParameter.getLoanPurpose(), "3", 6)
                .when(apiApplyParameter.getLoanPurpose(), "4", 2)
                .when(apiApplyParameter.getLoanPurpose(), "5", 3)
                .when(apiApplyParameter.getLoanPurpose(), "6", 1)
                .end(1);
        weiKeJinRongData.setPurpose(loanUse);
        // 月收入 1：2000以下 2：2000~5000 3：5000~8000 4：8000~10000 5：10000以上
        Integer incomeMonth = ChooseEq.create()
                .when(apiApplyParameter.getMonthlySalary(), "1", 1)
                .when(apiApplyParameter.getMonthlySalary(), "2", 2)
                .when(apiApplyParameter.getMonthlySalary(), "3", 4)
                .when(apiApplyParameter.getMonthlySalary(), "4", 5)
                .when(apiApplyParameter.getMonthlySalary(), "5", 5)
                .end(1);
        weiKeJinRongData.setMonthIncome(incomeMonth);
        // 花呗额度 1：无额度 2：<5000 3：>5000
        Integer hbLimit = ChooseEq.create()
                .when(apiApplyParameter.getHbLimit(), "1", 1)
                .when(apiApplyParameter.getHbLimit(), "2", 2)
                .when(apiApplyParameter.getHbLimit(), "3", 3)
                .when(apiApplyParameter.getHbLimit(), "4", 3)
                .when(apiApplyParameter.getHbLimit(), "5", 3)
                .end(1);
        weiKeJinRongData.setAntCredit(hbLimit);
        // 协议列表
        weiKeJinRongData.setProtocols(CollUtils.newArrayList(newList -> {
            ApiPlatApplyWeiKeJinRong.Protocol protocolList = new ApiPlatApplyWeiKeJinRong.Protocol();
            protocolList.setProtocolName("个人信息授权协议");
            protocolList.setProtocolUrl(H5DomainUrlUtils.createUserProtocolUrl(apiApplyParameter.getProductPlanId(), apiApplyParameter.getPhoneMd5()));
            newList.add(protocolList);
        }));
        // 加密
        AES aes = AES.createCbc(KEY.getBytes(), IV.getBytes());
        String dataStr = aes.encryptToBase64Str(JsonUtils.toJson(weiKeJinRongData));
        return JsonUtils.toJson(MapUtils.newHashMap(newMap -> {
            newMap.put("organCode", ORGAN_CODE);
            newMap.put("data", dataStr);
        }));
    }

    @Override
    public RespPlatformPhoneMd5Apply respApply(String respJson) throws Exception {
        JSONObject jsonObject = JsonUtils.get(respJson);
        if (jsonObject == null) {
            return RespPlatformPhoneMd5Apply.ofFail();
        }
        if (!Eq.object(jsonObject.getInteger("code"), 200)) {
            return RespPlatformPhoneMd5Apply.ofFail();
        }
        // 获取响应数据
        String resData = jsonObject.getString("data");
        if (!ValidParam.isNotEmpty(resData)){
            return RespPlatformPhoneMd5Apply.ofFail();
        }
        // 解密
        AES aes = AES.createCbc(KEY.getBytes(), IV.getBytes());
        String decData = aes.decryptFromBase64Str(resData);
        JSONObject data = JsonUtils.get(decData);
        if (!ValidParam.isNotEmpty(data)){
            return RespPlatformPhoneMd5Apply.ofFail();
        }
        if (!Eq.object(data.getInteger("result"), 1)){
            return RespPlatformPhoneMd5Apply.ofFail();
        }
        return RespPlatformPhoneMd5Apply.ofSuc();
    }

    @Override
    public RespPlatformNoticeApply parseApplyNotice(RequestVO requestVO) {
        return null;
    }

    @Override
    public Map<String, Object> respApplyNotice(ApiBizStatus apiBizStatus) {
        return Map.of();
    }
}
